#define ElemType int

#include "common.h"

int findMin(int* nums, int numsSize);

int main()
{
	return 0;
}

int findMin(int* nums, int numsSize)
{
	int beacon = nums[0];
	if (numsSize == 1 || beacon < nums[numsSize - 1])
		return beacon;

	int lo = 0, hi = numsSize;
	while (lo < hi) {
		int mid = lo + (hi - lo >> 1);
		int cur_val = nums[mid];
		if (cur_val >= beacon)
			lo = mid + 1;
		else
			hi = mid;
	}

	return nums[lo];
}
